﻿/*
 * Created by SharpDevelop.
 * User: JD
 * Date: 2014/7/7
 * Time: 14:56
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.Web.Mvc;
using OrchardForkTest.Model;
using OrchardForkTest.Service;

namespace OrchardForkTest.Controllers
{
    public class HomeController : Controller
    {
        private readonly ITestService _testService;
        public HomeController(ITestService testService)
        {
            _testService = testService;
        }

        public ActionResult Index()
        {
            try
            {
                // 无事务操作
                var userInfo = new UserInfo
                {
                    UserName = "控制器入口：" + Guid.NewGuid().ToString("N"),
                    Password = "测试密码",
                    NickName = "测试昵称",
                    Address = "测试地址"

                };
                userInfo.Save();

                //_testService.Test();
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.Message);
            }
            return View();
        }

    }
}
